<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	template="/layout/template.xhtml">

	<ui:define name="body">

		<h:form id="userRoleForm">

			<rich:panel>
				<f:facet name="header">userRole</f:facet>
				<h:panelGrid columns="1">
					<s:decorate id="nameField" template="/layout/edit.xhtml">
						<ui:define name="label">User Name</ui:define>
						<h:inputText id="name" required="true"
							value="#{userHome.instance.username}" />
					</s:decorate>

					<s:decorate id="email" template="/layout/edit.xhtml">
						<ui:define name="label">E-Mail</ui:define>
						<h:inputText id="name" required="true"
							value="#{userHome.instance.email}" />
					</s:decorate>

					<s:decorate id="name" template="/layout/edit.xhtml">
						<ui:define name="label">Name</ui:define>
						<h:inputText id="name" required="true"
							value="#{userHome.instance.name}" />
					</s:decorate>
					<s:decorate id="surname" template="/layout/edit.xhtml">
						<ui:define name="label">Surname</ui:define>
						<h:inputText id="name" required="true"
							value="#{userHome.instance.surname}" />
					</s:decorate>


					<s:decorate id="roleSelect" template="/layout/edit.xhtml"
						rendered="#{userRoleList.resultList!=null}">
						<ui:define name="label">#{messages.selectRoles}</ui:define>
						<rich:pickList id="selOrg" value="#{userHome.instance.userRoles}">
							<s:selectItems value="#{userRoleList.resultList}" var="_userRole"
								label="#{_userRole.roleName}" />
							<s:convertEntity></s:convertEntity>
						</rich:pickList>
					</s:decorate>

				</h:panelGrid>

			</rich:panel>

			<div class="actionButtons">
				<h:commandButton id="save" value="Save" action="#{userHome.persist}"
					rendered="#{!userHome.managed}" />
				<h:commandButton id="update" value="Save"
					action="#{userHome.update}" rendered="#{userHome.managed}" />
				<h:commandButton id="delete" value="Delete"
					action="#{userHome.remove}" immediate="true"
					rendered="#{userHome.managed}" />
				<s:button propagation="end" id="cancel" value="Cancel"
					view="/Settings/User/userList.xhtml" />
			</div>

		</h:form>

	</ui:define>

</ui:composition>